package com.wps.wdztv6.service;

import com.wps.wdztv6.common.R;
import com.wps.wdztv6.entity.ThirdFile;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public interface FileService {
    R<ThirdFile> getFileByFileVersionId(String fileId);
    R<ThirdFile> getLatestFileByFileId(String fileId);
    R<ThirdFile> saveFileNewVersion(String fileId, MultipartFile file);
    R<ThirdFile> getFileByVersion(String fileId,Integer version);
    R<List<ThirdFile>> getFileHistory(String fileId);
    String getFileSavePath(String fileId, String filename, Integer version);
    String getFileSavePath(String type);
    R<InputStream> getTemplateFile(String type);
    R<Long> getTemplateSize(String type);
    R<ThirdFile> createTemplateFile(String type);
    R<InputStream> downloadFile(String fileId, Integer version) throws IOException;
    String getDownloadUrl(String fileId, Integer version);
    String generateVersionFileId(String fileId, Integer version);

    R<String> getFileType(String filename);

    R<ThirdFile> fileRename(String fileId, String filename);
    void resetFile();
}
